import numpy as np
from matplotlib import pyplot as plt

us_file_path = "../US_video_data_numbers.csv"
uk_file_path = "../GB_video_data_numbers.csv"

# t1 = np.loadtxt(us_file_path,delimiter=",",dtype="int",unpack=True)
t_us = np.loadtxt(us_file_path, delimiter=",", dtype="int")

# 取评论数据
t_us_comment = t_us[:, -1]

# 选择比5000小的数据(先取所有发现数据集中在次范围)
t_us_comment = t_us_comment[t_us_comment <= 5000]

print(t_us_comment.max(), t_us_comment.min())

# 组数
d = 50

# 组距
bin_nums = (t_us_comment.max() - t_us_comment.min()) // d

# 绘图
plt.figure(figsize=(20, 8), dpi=80)

plt.hist(t_us_comment, bin_nums)

plt.show()
